﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Acms.Bll;
using Acms.DataControls;
using Acms.AcmsControls;

public partial class Templates_Standard_Default : Acms.AcmsControls.TemplatePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack){
            
            if (AcmsContext.CurrentPost != null){
                //FLASH STUFF
                flashFooter.Visible = false;
                var stripImageControl = AcmsContext.CurrentPost.FindPostControl("Strip Image");
                if (stripImageControl != null){
                    var stripImageProperties = stripImageControl.GetProperties<Acms.AcmsControls.ImageContentControlProperties>();
                    if (stripImageProperties != null && stripImageProperties.HasResource()){
                        flashFooter.Visible = true;
                        string url = null;
                        if (AcmsContext.CurrentPost.Path == "~")
                        {
                            url = "~/default.aspx";
                        }
                        else
                        {
                            url = string.Concat(AcmsContext.CurrentPost.Path, ".aspx");
                        }
                        flashFooter.Variables.Add("SettingsFilePath", AcmsContext.FullyQualifiedUrl(url, "FlashXml", this));
                        
                        flashFooter.Variables.Add("SiteRoot", string.Concat("http://", AcmsContext.SiteRoot));

                        flashFooter.Variables.Add("trackName", url);
                    }
                }
            }
            DataBind();
        }
    }
}
